< previous page page_109 next page >

Page 109
It turns out that the function will work even if you don't append the extra NULL character to the end of the strings. In fact, I have never seen a case where there is not a NULL character at the end of a string. So why do I explicitly add one anyway? Because there is nothing in the Windows or VB documentation that guarantees that a VB string will always have a NULL character after the string. Without that guarantee, Microsoft could change the way VB works at any time and thus break even compiled programs. By explicitly adding a NULL character, I make certain that the string will always be NULL-terminated.
The NT user manager now showed a user named Puzzle. The function worked!
The Puzzle, At Last
I hope you've enjoyed this chapter in real time. Now that you have a working test program, I leave you with the original question:
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
I'm trying to use the user_info_2 structure with the NetAddUser function from VBA. Part of this structure is: PBYTE usri2_logon_hours; points to a 21-byte (168 bits) bit string that specifies . . .
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
How do I include this in my type declaration? Also, there is a constant in the C header as:
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
#define USER_MAXSTORAGE_UNLIMITED ((unsigned long) -1L)
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
Isn't this a contradiction?
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
Should I just declare this as a long constant with the value of 1? Thanks in advance!
Can you answer his question?

 
< previous page page_109 next page >